package com.stone.business.jc.action;

/**
 * <pre>
 * 考试
 * @author
 * </pre>
 */

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import com.stone.business.jc.pojo.TCxxc;
import com.stone.business.jc.pojo.TKs;
import com.stone.business.jc.service.JcCommonService;
import com.stone.utils.StringUtils;

import frm.ssh.action.BaseListAction;

public class CxxcListAction extends BaseListAction {

	private static final long serialVersionUID = 3979577965804736350L;

	private JcCommonService myService;
	
	public JcCommonService getMyService() {
		return myService;
	}

	public void setMyService(JcCommonService myService) {
		this.service = myService;
		this.myService = myService;
	}
	
    /** * 构造方法. */
    public CxxcListAction() {
        this.entityClass = TCxxc.class;
    }

	/**
	 * 设置查询条件
	 */
	public HashMap<String, Object> setSearchCondition() {
		
		HashMap<String, Object> m = new HashMap<String, Object>();
		
		List<Object> valsList = new ArrayList<Object>();
		
		m.put("cols", "new map(s.id as id, s.kssj as kssj,s.jssj as jssj, s.ksdd as ksdd, s.pxy as pxy, s.pxjh as pxjh)");

		String conditions = " state = '" + super.getSearchBean().getCon1() + "'";
		
		// 开始时间
		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon2())) {
			conditions += " AND TO_CHAR(s.kssj,'yyyy-MM-dd') >= ?";
			valsList.add(super.getSearchBean().getCon2());
		}
		
		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon3())) {
			conditions += " AND TO_CHAR(s.kssj,'yyyy-MM-dd') <= ?";
			valsList.add(super.getSearchBean().getCon3());
		}
		
//		// 变电站
//		if (!StringUtils.isNullOrBlankFull(super.getSearchBean().getCon4())) {
//			conditions += " AND s.bdzname like ?";
//			valsList.add("%" + super.getSearchBean().getCon4()+ "%");
//		}

		// 查询条件
		m.put("conditions",conditions);
		m.put("clause", " order by s.kssj Desc");
		m.put("alias", "s");//, TOrgan o
		m.put("vals", valsList.toArray());
		
	//	DictionaryService dicService = (DictionaryService) SpringUtil.getInstance().getBean("dicService");
	//	xslxList = dicService.findList("XSLX");
		
		return m;
		
	}

}
